package day06_OOP.demo02多个对象;

public class StudentPlay {
    public static void main(String[] args) {
        Student csw = new Student();
        csw.age=18;
        csw.name="崔胜旺";
        csw.play();
        Student a = new Student();
        a.age=19;
        a.name="崔胜旺分身1";
        a.play();
        Student b = new Student();
        b.age=20;
        b.name="崔胜旺分身2";
        b.play();
         Student[] arr={csw,a,b};
         Student max=arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (arr[i].age>max.age){
                max=arr[i];
            }
        }
        System.out.println(max.name);
    }
}
